#python3
# -*- coding: utf-8 -*-
"""
Created on 2018/6/29 下午9:12
@author  : Devin
@Software: PyCharm
"""
import urllib
from CxExtractor import Extractor
#url = 'https://iask.sina.com.cn/key/573ebac684ae6230f4de50e8.html'


# from Get_url import crawler
#
# class Get_qa(object):
# 	def __init__(self):
# 		pass
# 	@staticmethod
# 	def get_url(keywords,timeout=40,totalpages=1):
# 		c = crawler(keywords)
# 		c.set_timeout(timeout)
# 		c.set_total_pages(totalpages)
# 		c.run()
# 		return c.urls
#
# cx = Get_qa.get_url('冠心病',totalpages=2)
# print(cx)
url = 'http://www.baidu.com/link?url=H1s7mGuILPhFEfCaWhSSmOKKFeW1G9LH-n82tkUhuOlAqayh6NtFN3kMVxNInFtPCFAkBr19QA4321EzEzkzUq'
html = urllib.urlopen(url).read()
ext = Extractor(url=url,blockSize=4, image=False)

s = ext.getContext()
print(s)